#pragma once

/*抽象出直流电机的行为*/
typedef int (*bridge_motors_correct_fn_t)(void *self);     //正转
typedef int (*bridge_motors_inverse_fn_t)(void *self);     //反转
typedef int (*bridge_motors_hasten_fn_t)(void *self);      //加速
typedef int (*bridge_motors_decelerate_fn_t)(void *self);  //减速
typedef int (*bridge_motors_stop_fn_t)(void *self);        //停止

struct bridge_motors_i
{
    bridge_motors_correct_fn_t correct;
    bridge_motors_inverse_fn_t inverse;
    bridge_motors_hasten_fn_t  hasten;
    bridge_motors_decelerate_fn_t decelerate;
    bridge_motors_stop_fn_t stop;
};
